package com.asia5b.a5mall.middleware.logic.viewmodel.shop

import androidx.lifecycle.MutableLiveData
import com.asia5b.a5mall.middleware.base.SimpleViewModel
import com.asia5b.a5mall.middleware.model.shop.ShopCategoryModel
import io.reactivex.functions.Consumer

/**
 * Created by zhangyuncai on 2019/12/21.
 * @Note   店铺分类页面逻辑控制
 */
class ShopCategoryActivityVM :SimpleViewModel() {


    /**
     * @Note   加载分类
     * @param  shopId 店铺ID
     */
    fun loadCategory(shopId: Int) {

        val observable = shopApi.getShopCats(shopId)
        baseSubscribe(observable, Consumer { data ->
//            providerView().loadCategoryResult(data)
            loadCategoryResultLiveData.value=data
        })
    }
    val loadCategoryResultLiveData= MutableLiveData<ArrayList<ShopCategoryModel>>()
}